<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>后台管理中心</title>  
    <link rel="stylesheet" href="/Public/Admin/css/pintuer.css">
    <link rel="stylesheet" href="/Public/Admin/css/admin.css">
    <script src="/Public/Admin/js/jquery.js"></script>  
    <script src="/Public/js/function.js"></script> 
    
    <script src="/Public/Admin/js/pintuer.js"></script>
   
    
</head>
<body style="background-color:#f2f9fd;">
<div class="header bg-main">
  <div class="logo margin-big-left fadein-top">
    <h1><img src="/Public/Admin/images/y.jpg" class="radius-circle rotate-hover" height="50" alt="" />后台管理中心</h1>
  </div>
  <div class="head-l"><a class="button button-little bg-green" href="" target="_blank"><span class="icon-home"></span> 前台首页</a> &nbsp;&nbsp;<a href="##" class="button button-little bg-blue"><span class="icon-wrench"></span> 清除缓存</a> &nbsp;&nbsp;<a class="button button-little bg-red" href="login.html"><span class="icon-power-off"></span> 退出登录</a> </div>
</div>
<div class="leftnav">
  <div class="leftnav-title"><strong><span class="icon-list"></span>菜单列表</strong></div>
  <h2><span class="icon-user"></span>基本设置</h2>
  <ul style="display:block">
    <li><a href="info.html" target="right"><span class="icon-caret-right"></span>网站设置</a></li>
    <li><a href="pass.html" target="right"><span class="icon-caret-right"></span>修改密码</a></li>
    <li><a href="page.html" target="right"><span class="icon-caret-right"></span>单页管理</a></li>  
    <li><a href="adv.html" target="right"><span class="icon-caret-right"></span>首页轮播</a></li>   
    <li><a href="book.html" target="right"><span class="icon-caret-right"></span>留言管理</a></li>     
    <li><a href="column.html" target="right"><span class="icon-caret-right"></span>栏目管理</a></li>
  </ul>   
  <h2><span class="icon-pencil-square-o"></span>栏目管理</h2>
  <ul>
    <li><a href="list.html" target="right"><span class="icon-caret-right"></span>内容管理</a></li>
    <li><a href="add.html" target="right"><span class="icon-caret-right"></span>添加内容</a></li>
    <li><a href="cate.html" target="right"><span class="icon-caret-right"></span>分类管理</a></li>       
  </ul>  
  <h2><span class="icon-pencil-square-o"></span>用户管理</h2>
  <ul>
    <li><a href="<?php echo U('User/index');?>" target="right"><span class="icon-caret-right"></span>全部用户</a></li>
    <li><a href="<?php echo U('User/addUser');?>" target="right"><span class="icon-caret-right"></span>添加用户</a></li>       
  </ul> 
  <h2><span class="icon-pencil-square-o"></span>分类管理</h2>
  <ul>
    <li><a href="<?php echo U('Category/index');?>" target="right"><span class="icon-caret-right"></span>查看分类</a></li>
    <li><a href="<?php echo U('Category/AddCategory');?>" target="right"><span class="icon-caret-right"></span>添加分类</a></li>       
  </ul>
  <h2><span class="icon-pencil-square-o"></span>文章管理</h2>
  <ul>
    <li><a href="<?php echo U('Article/index');?>" target="right"><span class="icon-caret-right"></span>文章列表</a></li>
    <li><a href="<?php echo U('Article/AddArticle');?>" target="right"><span class="icon-caret-right"></span>添加文章</a></li>       
  </ul>
</div>
<script type="text/javascript">
$(function(){
  $(".leftnav h2").click(function(){
	  $(this).next().slideToggle(200);	
	  $(this).toggleClass("on"); 
  })
  $(".leftnav ul li a").click(function(){
	    $("#a_leader_txt").text($(this).text());
  		$(".leftnav ul li a").removeClass("on");
		$(this).addClass("on");
  })
});
</script>
<ul class="bread">
  <li><a href="{:U('Index/info')}" target="right" class="icon-home"> 首页</a></li>
  <li><a href="##" id="a_leader_txt">网站信息</a></li>
  <li><b>当前语言：</b><span style="color:red;">中文</php></span>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;切换语言：<a href="##">中文</a> &nbsp;&nbsp;<a href="##">英文</a> </li>
</ul>
<div class="admin">
  
    <div class="panel admin-panel margin-top" id="add">
      <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 增加用户</strong></div>
      <div class="body-content">
        <form method="post" class="form-x" id="add-form" action="<?php echo U('Category/AddCategory');?>">    
            <div class="form-group">
                <div class="label">
                  <label>分类名：</label>
                </div>
                <div class="field">
                  <input type="text" class="input w50" value="" name="name" data-validate="required:请输入分类名" />
                  <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                  <label>父级分类</label>
                </div>
                <div class="field">
                    <select id="sort1" name="pid" class="input w50">
                        <option  value="">请选择分类</option>
                        <option  value="0">一级分类</option>
                        <?php if(is_array($data)): foreach($data as $key=>$vo): ?><option   value=<?php echo ($vo["id"]); ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; ?>   
                    </select>
                
                    <script>
                    $(function(){
                        $('#sort1').change(function(){
                            var pid =$('#sort1').val();
                            if(pid!=''&&pid!=0){
                                $.ajax({
                                    url:"<?php echo U('GetCategoryByPid');?>",
                                    data:"pid="+pid,
                                    type:'get',
                                    success:function(msg){
                                        var len= msg.length;
                                        if(len>0){
                                            $('#sort1').siblings('select').remove();
                                            $('#sort1').parent().append('<select id="sort2" class="input w50"> </select>');
                                            $('#sort2').append('<option  value="">请选择分类</option>');
                                            for (var i = 0; i < len; i++) {
                                                $('#sort2').append('<option  value='+msg[i]['id']+'>'+msg[i]['name']+'</option>');
                                            }
                                            $('#sort2').change(function(){
                                                    var val =$('#sort2').val();
                                                    if(val != ''){
                                                        $('#sort1').removeAttr('name');
                                                        $('#sort2').attr('name','pid');
                                                        $('#hidden').remove();
                                                    }else{
                                                        $('#sort2').removeAttr('name');
                                                        $('#sort1').attr('name','pid');
                                                    }
                                            });
                                        }else{
                                            $('#sort1').siblings('select').remove();
                                            // $('#hidden').remove();
                                        }
                                    }
                                });
                            }else{
                                $('#sort1').siblings('select').remove();
                            }                         
                        }); 

                    })
                    
                    </script>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>显示：</label>
                </div>
                <div class="field">
                    <div class="button-group radio">
                        <label class="button active">
                            <span class="icon icon-check"></span>             
                            <input name="display" value="1" type="radio" checked="checked">是             
                        </label> 
                        <label class="button">
                            <span class="icon icon-check"></span>             
                            <input name="display" value="0" type="radio" >否          
                        </label>             
        
                    </div>       
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                  <label></label>
                </div>
                <div class="field">
                  <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
                </div>
            </div>
        </form>
       
      </div>
    </div>
    

</div>
<div style="text-align:center;">
</div>
</body>
</html>